<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
            + path + "/";
%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<base href="<%=basePath%>">
<html>

<head>
    <meta charset="utf-8">
    <title>
        阳光成单系统
    </title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="format-detection" content="telephone=no">
    <link rel="stylesheet" href="System/css/x-admin.css" media="all">
</head>

<body>
<div class="x-body">
    <form class="layui-form" method="post" action="outbound/updateOutboundState">
        <div class="layui-form-item">
            <label class="layui-form-label">
            <span class="x-black">选择车辆</span>
        </label>
            <div class="layui-input-inline">
                <select name="car">
                    <option value="">所有车辆</option>
                    <c:forEach var="car" items="${cars}">
                        <option value="${car.carId}">${car.carNumber}</option>
                    </c:forEach>
                </select>
                <input type="hidden" name="outboundId" value="${outboundId}" id="outboundId">
                <input type="hidden" name="outboundNumber" value="${outboundNumber}" id="outboundNumber">
                <input type="hidden" name="outboundMark" value="${outboundMark}" id="outboundMark">
            </div>
        </div>
        <div class="layui-form-item">
            <%--@declare id="l_repass"--%><label for="L_repass" class="layui-form-label">
        </label>
            <button class="layui-btn" lay-filter="add" lay-submit="">
                立即添加
            </button>
        </div>
    </form>
</div>
<script src="System/lib/layui/layui.js" charset="utf-8">
</script>
<script src="System/js/x-layui.js" charset="utf-8">
</script>
<script>
    layui.use(['form','layer'], function() {
        $ = layui.jquery;
        var form = layui.form()
            , layer = layui.layer;

        //监听提交
        form.on('submit(add)', function(data){
            if(data.field.car!=null&&data.field.car!=""){
                location.href="outbound/updateOutboundState?car="+data.field.car+"&outboundId="+data.field.outboundId+"&outboundNumber="+data.field.outboundNumber+"&outboundMark="+data.field.outboundMark;
                var index = parent.layer.getFrameIndex(window.name);
                parent.layer.close(index);//关闭当前页
            }else{
                layer.msg('暂无空闲车辆!',{time:1000});
            }
            return false;
        });


    })
</script>

</body>

</html>